﻿using System;

namespace Validate.Net
{
    /// <summary>
    /// 验证QQ
    /// </summary>
    public class ValidateQQAttribute : ValidateRegularAttribute
    {
        private static string regularStr = @"[1-9]([0-9]{4,10})";

        public ValidateQQAttribute() : base(regularStr)
        { }

        public override bool Validate(object value, out string msg)
        {
            if (base.Validate(value, out msg))
                return true;
            else
            {
                msg = "QQ格式校验失败";
                return false;
            }
        }
    }
}
